import React, { Fragment } from "react";
import { HashRouter, Route, Switch, Redirect } from "react-router-dom";
import { Provider } from "react-redux";

import HomePage from "./pages/homePage";
import Login from "./pages/login";
import Test from "./pages/test";
import store from "./store/homePage";

function App() {
  return (
    <Fragment>
      <HashRouter>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <Route path="/test" component={Test}></Route>
          <Provider store={store}>
            <Route path="/home" component={HomePage}></Route>
            <Route exact path="/" component={HomePage}></Route>
            <Redirect to={"/home"} />
          </Provider>
        </Switch>
      </HashRouter>
    </Fragment>
  );
}

export default App;
